package com.dooioo.fangyou.dao.ibatis;

import com.dooioo.fangyou.dao.QueryDao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import java.util.List;
import java.util.Map;

/**
 * com.dooioo.fangyou.dao.ibatis
 * User: kqy
 * Date: 2010-11-30
 * Time: 14:52:10
 */

//泛型无作用
public class QueryDaoImpl<T> extends SqlMapClientDaoSupport implements QueryDao<T>{

    private SqlMapClientTemplate sqlMapClient;
    public QueryDaoImpl() {
        sqlMapClient = getSqlMapClientTemplate(); 
    }
    public <T> T queryForObject(String sqlId) {
        return null;  
    }

    public <T> T queryForObject(String sqlId, Map<String, Object> bindParams) {
        return (T) sqlMapClient.queryForObject(sqlId, bindParams);
    }

    public <T> T queryForObject(String sqlId, T entityObject) {
        return null;
    }

    public Map<String, Object> queryForMap(String sqlId) {
        return null;
    }

    public Map<String, Object> queryForMap(String sqlId, Map<String, Object> bindParams) {
        return null;
    }

    public Map<String, Object> queryForMap(String sqlId, T entityObject) {
        return null;
    }

    public Map<String, Object> queryForMap(String sqlId, Map<String, Object> bindParams, T entityObject) {
        return null;
    }

    public <T> T[] queryForArray(String sqlId) {
        return null;
    }

    public <T> T[] queryForArray(String sqlId, Map<String, Object> bindParams) {
        return null;
    }

    public <T> T[] queryForArray(String sqlId, T entityObject) {
        return null;
    }

    public <T> T[] queryForArray(String sqlId, Map<String, Object> bindParams, T entityObject) {
        return null;
    }

    public <E> E[] queryForArray(String sqlId, Map<String, Object> bindParams, T entityObject, int beginIndex, int maxCount) {
        return null;
    }

    public <E> E[] queryForArray(String sqlId, T entityObject, int beginIndex, int maxCount) {
        return null;
    }

    public Map<String, Object>[] queryForMapArray(String sqlId) {
        return null;
    }

    public Map<String, Object>[] queryForMapArray(String sqlId, Map<String, Object> bindParams) {
        return null;
    }

    public Map<String, Object>[] queryForMapArray(String sqlId, T entityObject) {
        return null;
    }

    public Map<String, Object>[] queryForMapArray(String sqlId, Map<String, Object> bindParams, int beginIndex, int maxCount) {
        return null;
    }

    public <T> List<T> queryForList(String sqlId) {
        return sqlMapClient.queryForList(sqlId);  
    }

    public <T> List<T> queryForList(String sqlId, Map<String, Object> bindParams) {
        return sqlMapClient.queryForList(sqlId, bindParams);  
    }

    public <T> List<T> queryForList(String sqlId, T entityObject) {
        return null;
    }

    public <T> List<T> queryForList(String sqlId, Map<String, Object> bindParams, T entityObject) {
        return null;
    }

    public <T> List<T> queryForList(String sqlId, Map<String, Object> bindParams, T entityObject, int beginIndex, int maxCount) {
        return null;
    }

    public List<Map<String, Object>> queryForMapList(String sqlId, Map<String, Object> bindParams) {
        return null;
    }

    public List<Map<String, Object>> queryForMapList(String sqlId, Map<String, Object> bindParams, T entityObject) {
        return null;
    }

    public List<Map<String, Object>> queryForMapList(String sqlId, Map<String, Object> bindParams, int beginIndex, int maxCount) {
        return null;
    }

    public int insert(String sqlId, T entityObject) {
        return sqlMapClient.update(sqlId, entityObject);
    }

    public int insert(String sqlId, Map<String, Object> bindParams) {
        return 0;
    }

    public int update(String sqlId, T entityObject) {
        return sqlMapClient.update(sqlId, entityObject);
    }

    public int update(String sqlId, Map<String, Object> bindParams) {
        return 0;
    }

    public int delete(String sqlId, String id) {
        return sqlMapClient.update(sqlId, id);
    }

    public int delete(String sqlId, Map<String, Object> bindParams) {
        return 0;  
    }
}
